"""
    储存 form 定义
"""
from django import forms
from captcha.fields import CaptchaField


class LoginForm(forms.Form):
    #  required 限制必填
    username = forms.CharField(required=True)
    password = forms.CharField(required=True, min_length=5)


class RegisterForm(forms.Form):
    #  required 限制必填
    email = forms.EmailField(required=True)
    password = forms.CharField(required=True, min_length=5)
    captcha = CaptchaField(error_messages={"invalid": "验证码错误"})  # 验证码


class ForgetForm(forms.Form):
    #  required 限制必填
    email = forms.EmailField(required=True)
    captcha = CaptchaField(error_messages={"invalid": "验证码错误"})  # 验证码


class ModifyPwdForm(forms.Form):
    #  required 限制必填
    email = forms.EmailField(required=True)
    password1 = forms.CharField(required=True, min_length=5)
    password2 = forms.CharField(required=True, min_length=5)
